fix(web): fix header action labels collapsing too early by correcting flex distribution#1039
Conversation
… flex distribution The header split 50/50 between title and actions via two flex-1 divs. Both children had flex: 1 1 0%, giving the actions div only 398px at 1100px viewport — barely above the @sm (384px) threshold. Labels collapsed to icons at ~1060px even though there was plenty of room. - Change title div from flex-1 to flex-initial shrink so it takes only its content width instead of always claiming 50% - Add overflow-hidden to actions div to prevent button overflow - Revert label shortening from PR pingdotgg#771 (full text now fits) The @container/header-actions query stays on the actions div, now measuring ~660px at 1100px (actual available space) instead of 398px. Labels stay visible until the viewport genuinely gets tight. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
34b5f26 to
ae2bb04
Compare
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip CodeRabbit can scan for known vulnerabilities in your dependencies using OSV Scanner.OSV Scanner will automatically detect and report security vulnerabilities in your project's dependencies. No additional configuration is required. |
|
screenshots/recordings plss |
What Changed
flex-1toflex-initial shrinkso it only takes the space it needs instead of always claiming 50% (ChatHeader.tsxline 58)overflow-hiddento the actions div to prevent button overflow into the diff toggle (ChatHeader.tsxline 77)GitActionsControl.logic.ts,.test.ts)5 lines changed across 3 files, 0 lines added or removed.
Why
The header was split 50/50 between title and actions via two
flex-1divs. Both children hadflex: 1 1 0%, splitting the available space exactly in half (398px each at 1100px viewport). The@container/header-actionscontainer query on the actions div measured only that 398px — barely above the@sm(384px) threshold — so button labels collapsed to icons at ~1060px viewport width even though there was plenty of room.This 50/50 split was introduced accidentally in commit
ce96ad0b("UI fixes"). Before that commit, the title had noflex-1and the actions div usedshrink-0with the parent usingjustify-between. The restructuring gave both childrenflex-1as a side effect.The maintainer identified this as the root cause in PR #773:
The fix: Change the title div from
flex-1toflex-initial shrink. Now the title takes only its content width (~132px for a typical short title) and the actions div claims all remaining space viaflex-1. The@container/header-actionsquery stays on the actions div and now measures the actual available space (~660px at 1100px instead of 398px), keeping labels visible until the viewport genuinely gets tight.overflow-hiddenon the actions div prevents any remaining edge-case overflow from reaching the diff toggle button.UI Changes
Before (1100px viewport): Header action labels ("Build", "Open", "Commit & push") collapse to icon-only mode because the 50/50 split gives the actions div only 398px (barely above the 384px
@smthreshold).After (1100px viewport): All action labels are fully visible. The title takes only ~132px, leaving ~660px for actions — well above the 384px threshold.
Checklist
Fixes #626. Fixes #806.
Related: #457, #399, #713, #426 (other header layout issues improved by better flex distribution).
Reverts label-shortening bandaid from #771 (no longer needed).
Obsoletes #773 (different approach to the same problem, as discussed by maintainer).
Note
Fix header action labels collapsing too early by correcting flex distribution in
ChatHeaderflex-1toflex-initial shrinkso it no longer grows to fill all available space, preventing the right action area from being squeezed out.overflow-hiddento the right actions container to clip any remaining overflow.commit_push_prquick action label from "Commit, push & PR" to "Commit, push & create PR" inGitActionsControl.logic.tsfor clarity.Macroscope summarized ae2bb04.